<template>
  <view class="contont">
    <img :src="src" class="imageKnow_img"></img>
    <br>
    <small style="font-size: smaller;">*扫码添加老师微信 - 领取测算结果</small>
  </view>
</template>
<script>
import {getWxCodeByIp, QYcode} from "@/api/system/system";

export default {
  data() {
    return {
      src: '',
    }
  },
  onLoad() {
    this.getCode()
  },
  mounted() {
    this.detectDevice()
  },
  methods: {
    getCode() {
      getWxCodeByIp().then(res => {
        this.src = res.data[0].wxCode
      }).catch(() => {
      })
    },
    detectDevice() {
      const userAgent = navigator.userAgent;
      const isMobile = /Mobile|iP(hone|od)|Android/.test(userAgent);
      this.seen = !isMobile;
      if (this.seen) {
        document.querySelector('.contont').style.height = '100%';
      } else {
        document.querySelector('.contont').style.height = '100vh';
      }
    },
  }
}
</script>
<style lang="scss" scoped>
.contont {
  background-color: #FFFDF1;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  font-size: 0.15rem;
}

.imageKnow_img {
  width: 100%;
  display: block;
}
</style>
